﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AboutCompanyUC.ascx.cs"
    Inherits="VCN.home.UC.AboutCompanyUC" %>
<div id="AboutCompanyUC">
    <div class="style-head">
        <h2>
            About VCN Conpany</h2>
    </div>
    <div class="style-1-new">
        <%            
            VCN.App.DataAccessLayer.NewsDAO newDao = new VCN.App.DataAccessLayer.NewsDAO();
            VCN.App.DataTransferObjects.News v_new = newDao.selectCompanyNews();
            if (v_new != null)
            {
                Response.Write(string.Format("<div class='img'><a href='About.aspx?NId={1}'><img src='Images/News/{0}' alt='Ảnh công ty' /></a></div>", v_new.NewsImage, v_new.Id.ToString()));
                Response.Write(string.Format("<div class='title'><a href='About.aspx?NId={6}'>{0}</a></div><div class='time'>{1} {2:00}:{3:00}:{4:00}</div><div class='short-content'>{5}</div>", 
                    (v_new.Title.Length > 50)? v_new.Title.Substring(0, 50) + "..." : v_new.Title, v_new.CreatedDate.ToString("dd/MM/yyyy"),
                    v_new.CreatedDate.Hour, v_new.CreatedDate.Minute, 
                    v_new.CreatedDate.Second, (v_new.ShortContent.Length > 120)? v_new.ShortContent.Substring(0, 120) + "..." : v_new.ShortContent,v_new.Id));                
        %>
        <div class="button">
            <%
                Response.Write(string.Format("<a href='About.aspx?NId={0}'>Read more</a>", v_new.Id));
                
            %>
        </div>
        <%  } %>
    </div>
</div>
